<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改用户密码</title>
<link rel="stylesheet" type="text/css"href="static/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"href="static/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css" />
<link rel="icon" type="image/png" href="${basePath}static/adminManager/assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="${basePath}static/adminManager/assets/i/app-icon72x72@2x.png">
<link rel="stylesheet" href="${basePath}static/adminManager/assets/css/amazeui.min.css" />
<link rel="stylesheet" href="${basePath}static/adminManager/assets/css/admin.css">
<link rel="stylesheet" href="${basePath}static/adminManager/add/css/add.css">
<style>
	.bootint{width:600px !important;}
	.input-span-text{width:150px !important;}
	.form-control3{width:450px !important;}
	.btn{width:600px !important;}
</style>
</head>


<body id="pswbody">

<div class="admin-biaogelist">
	
   		<div class="listbiaoti am-cf">
      		<ul class="am-icon-flag on"> 修改密码</ul>
      		<dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">修改密码</a></dl>
    	</div>
    	
<div class="am-g tpl-g" >
	<div class="tpl-login">
		<div class="tpl-login-content">

	<form   id="pswform" class="form-horizontal"  action="ChangeAdminInfo"  style="margin-left:150px"
				enctype="multipart/form-data"  method="post">
				
		<div  class="registe-content">
					
			<div class="bootint">
					<span class="input-span-text ">旧密码：</span>
					<input type="password" class="form-control3" id="psw"name="psw" placeholder="请输入原密码">
					<input type="hidden" id="realPsw" name="realPsw" value="<%=session.getAttribute("adminPsw") %>"/>
					<input type="hidden" id="adminid" name="adminid" value="<%=session.getAttribute("adminId") %>"/>
				</div>
				
			<div class="bootint">
				<span class="input-span-text ">新密码：</span>
				<input type="password" class="form-control3" id="adminpsw"name="adminpsw" placeholder="请输入新密码（8-16位非空字符）">
			</div>
				
			<div class="bootint">
				<span class="input-span-text ">确认新密码</span>
				<input type="password" class="form-control3" id="adminpsw2"name="adminpsw2"placeholder="请再次输入新密码（两次输入密码保持一致）">
			</div>
			
			<div class="bootint" style="margin-bottom:30px">
					<button type="submit" class="btn btn-success btn-lg"  id="rebtn" onclick="return subPsw()" >提交</button>
			</div>
					
		</div>
				
	</form>
	
</div></div></div></div>

</body>


<script type="text/javascript"src="static/jquery-1.12.4/jquery-1.12.4.min.js"></script>
<script type="text/javascript"src="static/layer-v3.1.1/layer/layer.js"></script>
<!-- 表单验证 -->
<script type="text/javascript">
	function subPsw() {
		// 错误提示信息
		var strMsg = "";
		// 密码验证
		var psw = document.getElementById("psw").value;
		var psw2 = document.getElementById("realPsw").value;
		if (psw == null || psw == "") {
			// 增加提示信息
			strMsg += "请输入原密码!<br>";
		}
		if (psw != psw2) {
			// 增加提示信息
			strMsg += "旧密码错误!<br>";
		}
		var regPsw = /^.[A-z0-9]{7,15}$/;
		var adminpsw = document.getElementById("adminpsw").value;
		if (adminpsw == null || adminpsw == ""||regPsw.test(adminpsw) === false) {
			// 增加提示信息
			strMsg += "请输入正确格式的新密码!<br>";
		}
		var adminpsw2 = document.getElementById("adminpsw2").value;
		if (adminpsw != adminpsw2) {
			// 增加提示信息
			strMsg += "两次密码不一致！";
		}
		if (strMsg == "") {
			//提示
			layer.msg('修改成功');
			return true;
			
		} else {
			// 验证不通过
			layer.open({
				icon:5,
				title : '提示',
				content : strMsg
			});
			return false;
		}
	}

	function doSubmit() {
		document.getElementById("pswform").submit();
		
	}
</script>


</html>
